package com.shisfish.library.Impl;

import java.util.List;

import org.springframework.context.ApplicationContext;

import com.shisfish.library.Inter.IPurchaseInter;
import com.shisfish.library.Model.Purchase;
import com.shisfish.library.Utils.Global.GetACXmlUtils;

public class PurchaseImpl implements IPurchaseInter {

	private ApplicationContext ac = GetACXmlUtils.getACXml();
	private IPurchaseInter mapper = (IPurchaseInter) ac.getBean("purchaseMapper");
	
	@Override
	public int insertOne(Purchase t) {
		// TODO Auto-generated method stub
		return mapper.insertOne(t);
	}

	@Override
	public int insertAll(List<Purchase> list) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int updateOne(Purchase t) {
		// TODO Auto-generated method stub
		return mapper.updateOne(t);
	}

	@Override
	public int updateAll(List<Purchase> list) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public List<Purchase> selectById(int id) {
		// TODO Auto-generated method stub
		return mapper.selectById(id);
	}

	@Override
	public List<Purchase> selectByKey(String key) {
		// TODO Auto-generated method stub
		return mapper.selectByKey(key);
	}

	@Override
	public int countAll() {
		// TODO Auto-generated method stub
		return mapper.countAll();
	}

	@Override
	public List<Purchase> selectAll() {
		// TODO Auto-generated method stub
		return mapper.selectAll();
	}

	@Override
	public int deleteOneById(int id) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int deleteAllById(List<?> ids) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int deleteOneByKey(String key) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int deleteAllByKey(List<?> keys) {
		// TODO Auto-generated method stub
		return 0;
	}

	public int countBySerial(String serail) {
		// TODO Auto-generated method stub
		return mapper.countBySerial(serail);
	}

	public int countByType(int type, String supplier) {
		// TODO Auto-generated method stub
		return mapper.countByType(type, supplier);
	}

	public List<Purchase> selectByTypePage(int type, String supplier, int currentPage,
			int pageSize) {
		// TODO Auto-generated method stub
		return mapper.selectByTypePage(type, supplier, currentPage, pageSize);
	}

}
